import axios from 'axios';
import { Url } from '@/config';
// axios拦截器
const request = axios.create({
  baseURL: process.env.NODE_ENV === ' development' ? Url.baseUrl.dev : Url.baseUrl.pro,
});
request.interceptors.response.use((res) => {
  if (res.status === 200 && res.data.code === 200) {
    return res.data;
  }
  return Promise.reject(res);
}, (error) => {
  throw error;
});
export default request;
